package com.atguigu.controller;

import com.atguigu.service.PaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class PaymentController {

    @Resource
    private PaymentService paymentService;

    @GetMapping("/payment/error/{id}")
    public String payment_error(@PathVariable("id") Integer id){
        return paymentService.paymnet_ERROR(id);
    }
    @GetMapping("/payment/ok")
    public String payment_OK(){
        return paymentService.payment_OK();
    }

    @GetMapping("/payment/circuit/{id}")
    public String Circuit(@PathVariable("id") Integer id){
        return paymentService.paymentCircuitBreaker(id);
    }
}
